<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>03.const使用</title>
</head>

<body>
  <script>
    /* 
    const的使用:const用来声明常量，值不能修改的量叫常量。
     */
    const SCHOOL = "尚硅谷";
    //1.const声明一定要赋值，不赋值不行
    //const A;//03.const使用.html:19 Uncaught SyntaxError: Missing initializer in const declaration

    //2.一般常量要大写（但是不是强制规定）
    const a = 100;

    //3.常量的值不能修改
    //SCHOOL="ATGUIGU";//03.const使用.html:25 Uncaught TypeError: Assignment to constant variable.

    //4.块级作用域
    /* {
      const player = "uzi";
    }
    console.log(player); */

    //5.对于数组和对象的元素修改，不算着对常量的修改,不会报错
    const TEAM = ["UZI", "MLXG", "MING", "letMe"];
    TEAM.push("Meiko");
    console.log(TEAM);
  </script>
</body>

</html>